www.beck-ipc.com

@CHIP-RTOS C Library - BIOS API


BIOS_Install_Error_Handler

Install a user fatal error handler.

USER_ERROR_HANDLER BIOS_Install_Error_Handler ( USER_ERROR_HANDLER vector );

Parameters

vector

Far pointer to callback procedure.  Set to zero to un-install the handler.

Return Value

Old handler (since SC1x RTOS V1.25 and SC1x3/SC2x RTOS V1.20)

Comments

The user can install an error handler function, that will execute if a fatal error occurs in an application or inside of the @CHIP-RTOS.

The callback function must have the following form:

    void huge _pascal Err_Handler (int error_code)

The error_code input parameter can have the following values:
1: Invalid opcode (usually caused by corrupted memory). The current task will be suspended.
2: Fatal kernel error (usually caused by corrupted memory or a task stack overflow)
3: Fatal internal TCPIP error, calling task is supended
4: TCPIP stack reaches memory limit
5: TCPIP memory allocation error
6: Ethernet bus error (hardware defect)
7: Ethernet link error(SC13 only, cable not connected?)
8: Flash write error -> Flash defect (IPC@CHIP® is no longer usable)
9: Low Memory error -> called if an alloc (system or user) failed
10: RTOS memory list corrupted
Error codes in the range[1000..9999] are reserved for Beck drivers or libraries. Currently the following codes are used:
1000: GCLIB - The communication between the IPC@CHIP® and the graphics controller failed. Error codes starting from 10000 can be used by user applications.

In all cases (except error code 7 and 9, driver/library and application codes depend) we recommend to reboot the IPC@CHIP® (see below). If the flash device has a defect, the IPC@CHIP® is no longer usable

Important:
Do not use any message printing inside your error handler if errorcode is 3 or 4 and telnet is part of your stdio.   In this case your exit handler would hang inside of the print call.

See Also

RTOS API

This library function invokes a RTOS software interrupt.   Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    V1.25V1.25V1.25V1.20V1.20

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document